package com.knight.study.patterns.tujie.abstractFactory;

import java.util.Iterator;

/**
 * @Author knight
 * @Date 2024/9/11 10:55
 */

public class ListPage extends Page{
    public ListPage(String title, String author) {
        super(title, author);
    }

    @Override
    public String makeHTML() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("<html>" + title + "</title>");
        final Iterator it = content.iterator();
        while (it.hasNext()) {
            Item item = (Item) it.next();
            buffer.append(item.makeHtml());
        }
        return buffer.toString();
    }
}
